package main

import (
	"fmt"
	"sync"
)

/*
	启动多个goroutine
*/

var wg sync.WaitGroup

func main() {
	for i := 0; i < 10; i++ {
		wg.Add(i)
		go test(i)
	}
	wg.Wait()
}

func test(i int) {
	defer wg.Done()
	fmt.Print("Hello,goroutine!", i)

}
